import Toast from './toast'
export default {
  install(Vue, options) {
    Vue.prototype.$toast = function(message) {
      const Constructor = Vue.extend(Toast)
      const toast = new Constructor({
        propsData: {}
      })
      toast.$slots.default = [message]
      toast.$mount() // 挂载到生命周期
      document.body.appendChild(toast.$el) // $el插入内容
    }
  }
}
